import java.util.Scanner;

public class Triangle {
    public static boolean isTriangle(int a, int b, int c) throws IllegalArgumentException {
        if (a + b > c && a + c > b && b + c > a) {
            System.out.println("这三条边能构成三角形，并且三边长分别为：" + a + "," + b + "," + c);
            return true;
        } else {
            throw new IllegalArgumentException(a + "," + b + "," + c + "这三条边不能够构成三角形");
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请依次输入三角形的a，b，c三个边长：");
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        try {
            isTriangle(a, b, c);
        } catch (IllegalArgumentException e) {
            System.out.println("异常：" + e.getMessage());
        }
    }
}
